package aop;

import entity.User;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import service.UserService;

import static org.junit.Assert.*;

public class UserServiceLoggerTest {

    @Test
    public void aopTest() {
        ApplicationContext ctx = new ClassPathXmlApplicationContext("userServiceLogger.xml");
        UserService service = (UserService) ctx.getBean("userService");
        
        User user = new User();
        user.setId(1);
        user.setUsername("test");
        user.setPassword("123456");
        user.setEmail("test@xxx.com");
        service.save(user);
    }
}